<template>
  <div class="detailCard">
    <h1 class="indexItemTime">{{ detailCardTime }}</h1>
    <div
      class="info_containerBacInfoStyle info_containerPadding"
      :class="{ blackBacColor: $store.state.lifeIndexBacColor }"
    >
      <div class="item_container">
        <div class="itemTitle flex-top">
          <div
            class="indexItemIcon"
            :class="[`${'g-' + this.detailObjs.type}`]"
            ref="icon_ref"
          ></div>
          <div class="itemName">{{ detailObjs.name }}</div>
        </div>
        <div class="itemState">{{ detailObjs.category }}</div>
      </div>

      <div class="item_container">
        <div class="itemTitle flex-top">
          <van-icon
            name="comment-circle"
            size="0.4rem"
            style="margin-right: 0.14rem"
            color="#ff4e50a6"
          />
          <span class="itemName">详细预告</span>
        </div>
        <p class="itemState" style="text-align: left">{{ detailObjs.text }}</p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "DetailedCard",
  data() {
    return {};
  },
  props: {
    detailObjs: Object,
  },
  computed: {
    detailCardTime() {
      let d = new Date(this.detailObjs.date);
      return d.getMonth() + 1 + "月" + d.getDate() + "日";
    },
  },
  mounted() {
    console.log(this.$refs.icon_ref);
  },
};
</script>

<style scoped>
.detailCard {
  position: relative;
  margin: 0.5rem auto 0;
  width: 85%;
  height: auto;
}
.item_container {
  margin-bottom: 0.15rem;
  text-align: center;
}
.itemTitle {
  margin-bottom: 0.1rem;
}
.itemTitle .itemName {
  font-size: 0.17rem;
}
.item_container .itemState {
  font-size: 0.15rem;
}
.indexItemTime {
  font-size: 0.3rem;
  margin-bottom: 0.25rem;
}
.blackBacColor {
  background-color: #2d2e32;
  border: none;
}
</style>